<template>
  <div class="header">
    <div class="shade" v-show="showShade">
      <div class="item">
        <div class="title">{{seller.name}}</div>
        <el-rate
          v-model="seller.score"
          disabled
          show-score
          text-color="#ff9900"
          score-template="{value}"
        >
        </el-rate>
      </div>
      <div class="item">
        <el-divider>优惠信息</el-divider>
        <ul>
          <li v-for="(item,index) of seller.supports" :key="index"><i class="el-icon-s-promotion"></i>&nbsp; {{item.description}}</li>
        </ul>
      </div>
      <div class="item">
        <el-divider>商家公告</el-divider>
        <div>{{seller.bulletin}}</div>
      </div>
      <div class="close" @click="close">
        <i class="el-icon-circle-close"></i>
      </div>
    </div>
    <div class="baseinfo">
      <div class="imgbox">
        <img :src="seller.avatar" alt="">
      </div>
      <div class="info">
        <div class="title">
          <span>{{seller.tag}}</span>
          <span>{{seller.name}}</span>
        </div>
        <div class="state">{{seller.state}}&nbsp; {{seller.time}}</div>
        <div class="address"><i class="el-icon-location"></i> {{seller.address}}</div>
        <div class="supports">
          {{seller.supports[0].description}}
          <div class="more" @click="more">{{seller.supports.length}}个<i class="el-icon-arrow-right"></i> </div>
        </div>
      </div>
    </div>
    <div class="notice">
      公告：{{seller.bulletin}}
      <span @click="more"><i class="el-icon-arrow-right"></i></span>
    </div>
  </div>
</template>

<script>
// import { mapState } from "vuex";
export default {
  name: "Header",
  data() {
    return {
      value: 3.5,
      showShade: false
    };
  },
  methods: {
    more() {
      this.showShade = true;
      console.log(this.seller);
    },
    close() {
      this.showShade = false;
    },
  },
  computed:{
    seller(){
      return this.$store.state.getDataAbout.data.seller
    }
  },

};
</script>

<style scoped>
.header {
  color: #666;
  height: 120px;
  font-size: 0.8rem;
  background-image: url(../assets/bg.jpg);
}
.baseinfo {
  font-size: 0.7rem;
  height: 100px;
  display: flex;
  flex-direction: row;
}
.imgbox {
  width: 60px;
  height: 60px;
  margin: 20px;
}
.imgbox img {
  width: 100%;
  height: 100%;
  border-radius: 10px;
}
.info {
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.title {
  margin-bottom: 5px;
}
.title span:nth-child(1){
  border-radius: 10px;
  background: rgb(255, 99, 99);
  color: #fff;
  font-size: 10px;
  padding: 0 5px;
}
.title span:nth-child(2) {
  padding-left: 10px;
  font-size: 15px;
  color: #000;
}
.supports{
  color: #333;
}
.more {
  position: absolute;
  right: 17px;
  top: 67px;
  width: 40px;
  height: 16px;
  border-radius: 20px;
  font-size: 9px;
  background: rgba(160, 160, 160, 0.5);
  text-align: center;
}
.notice {
  width: 100%;
  height: 20px;
  background: rgba(160, 160, 160, 0.5);
  position: relative;
  color: #333;
  padding: 0 40px 0 10px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  position: relative;
}
.notice span {
  right: 20px;
  position: absolute;
  bottom: 3px;
}
.shade {
  z-index: 4000;
  position: fixed;
  top: 0;
  width: 100%;
  height: 100vh;
  background: rgba(0, 0, 0, 0.8);
}

.shade {
  padding: 60px 20px 0;
  color: #fff;
  line-height: 30px;
}
.shade .title {
  font-size: 18px;
}
.shade .item:nth-child(1) {
  height: 60px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  align-items: center;
}
/* .shade .item:nth-child(1){
	height: 60px;
	justify-content: space-around;
} */
.shade .item:nth-child(2) {
  text-align: left;
}
.shade .item:nth-child(2) li {
  padding-left: 30px;
  line-height: 25px;
}
.el-divider {
  background-color: rgb(87, 87, 87);
}
.shade .item:nth-child(3) div {
  padding: 0 30px;
}
.close {
  position: absolute;
  bottom: 50px;
  right: 50%;
  transform: translate(50%);
  font-size: 40px;
  color: rgba(133, 133, 133, 0.8);
}
</style>